package com.ean.backpack.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ean.backpack.domain.Propertyattributelink;
import com.ean.backpack.domain.PropertyattributelinkPK;
import com.ean.backpack.repository.PropertyattributelinkRepository;
import com.ean.backpack.service.PropertyattributelinkService;

@Service
@Transactional
public class PropertyattributelinkServiceImpl implements
		PropertyattributelinkService {

	@Autowired
	PropertyattributelinkRepository propertyattributelinkRepository;

	public long countAllPropertyattributelinks() {
		return propertyattributelinkRepository.count();
	}

	public void deletePropertyattributelink(
			Propertyattributelink propertyattributelink) {
		propertyattributelinkRepository.delete(propertyattributelink);
	}

	public Propertyattributelink findPropertyattributelink(
			PropertyattributelinkPK id) {
		return propertyattributelinkRepository.findOne(id);
	}

	public List<Propertyattributelink> findAllPropertyattributelinks() {
		return propertyattributelinkRepository.findAll();
	}

	public List<Propertyattributelink> findPropertyattributelinkEntries(
			int firstResult, int maxResults) {
		return propertyattributelinkRepository.findAll(
				new org.springframework.data.domain.PageRequest(firstResult
						/ maxResults, maxResults)).getContent();
	}

	public void savePropertyattributelink(
			Propertyattributelink propertyattributelink) {
		propertyattributelinkRepository.save(propertyattributelink);
	}

	public Propertyattributelink updatePropertyattributelink(
			Propertyattributelink propertyattributelink) {
		return propertyattributelinkRepository.save(propertyattributelink);
	}
}
